package persistencia;

import java.sql.*;

public class Conexao {

	static String status = "Conexao nao estabelecida";

	static public Connection getConnection() {
		Connection conexao = null;

		try {
			Class.forName("com.mysql.jdbc.Driver").newInstance();
			conexao = DriverManager.getConnection(
					"jdbc:mysql://myplan.myftp.org:3306/myplan", "myplan",
					"775533");
			status = "Conexao estabelecida";
		}

		catch (SQLException e) {
			status = e.getMessage();
		}

		catch (ClassNotFoundException e) {
			status = e.getMessage();
		}

		catch (Exception e) {
			status = e.getMessage();
		}

		return conexao;
	}

	public static String getStatus() {
		return status;
	}

}
